<template>
  <div>
    <span v-for="(item,index) in arr" :key="index">
      <input type="checkbox" v-model="heyd" :value="item">{{item}}
    </span>
   <p>您选中的元素累加值为：{{jisuan}}</p>
  </div>
</template>

<script>
export default {
  computed:{
    jisuan(){
       return this.heyd.reduce((sum,item)=>sum+item,0)
      }
    // 
   
  },
data () {
  return {
    arr:[9, 15, 19, 25, 29, 31, 48, 57, 62, 79, 87],
    heyd:[]
  }
}
}
</script>

<style>

</style>